#include<vector>
#include<string>
#include<iostream>
#include<fstream>
#include<sstream>

using std::vector;
using std::string;
using std::cout;
using std::endl;
using std::istringstream;
using std::ifstream;



// TODO: Change the return type of ReadBoardFile.

 
  // TODO: Declare an empty board variable here with
  // type vector<vector<int>>.
  
 
      // TODO: Replace the "cout" code with a call to ParseLine 
      // for each line and push the results of ParseLine to the 
      // back of the board.
   
  // TODO: Return the board variable.

vector<vector<int>> ReadBoardFile(string path){
    ifstream boardfile;
    vector<vector<int>> vectors;
    boardfile.open(path,boardfile.in);
    if(boardfile.good()){
        string str;
        while (getline(boardfile,str))
        {
            vector<int> vector;
            int i;
            char c;
            istringstream iss(str);
            while (iss>>i>>c && c==',')  // && c !='\n'
            {
              vector.push_back(i);
            }
            vectors.push_back(vector);
        }
    }
    return vectors;
}



int main() {
   
  // TODO: Store the output of ReadBoardFile in the "board" variable.
    vector<vector<int>> board;
    board=ReadBoardFile("files/1.board");
  // TODO: Uncomment PrintBoard below to print "board".
    // print all elements in board.
    for(int i=0;i<board.size();i++){
      for (int j = 0; j < board[i].size(); j++)
      {
        cout<<board[i][j]<<' ';
      }
      cout<<'\n';
    }
  
  cout<<"hello,world!"<<'\n';
}